package thingtest.game;

import java.util.Observable;

public class Scenario extends Observable{

	private int width;
	private int height;
	private ListOfThings listOfThings;
	private Player player;

	public Scenario(int width, int height) {
		this.width = width;
		this.height = height;
		listOfThings = new ListOfThings();
	}

	public void put(Thing thing, Vector locationToPut) {

		thing.moveToThisPoint(locationToPut);
		this.listOfThings.add(thing);
		this.setChanged();
		this.notifyObservers();
		
	}

	public boolean contains(Thing thing) {
		return this.listOfThings.contains(thing);
	}

	public ListOfThings containedThings() {
		return listOfThings;
	}

	public void makeAllThingsAdvanceAtCurrentSpeed() {

		listOfThings.makeAllAdvance();
		this.setChanged();
		this.notifyObservers();
		
	}

	public void insertPlayer(Player player) {
		this.player = player;
		this.put(this.player.associatedThing(), this.player.associatedThing().location());
		this.player.assignTo(this);
		
	}

	public Player playerContained() {
		return player;
	}

}
